package com.atguigu.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author lk
 * @version 1.0.0
 * @Description RegisterVo
 * @createTime 2024/1/24 21:12
 */
@Data
public class RegisterVo {

    /**
     * 用户名
     */
    @NotEmpty(message = "用户名必须填写")
    @Length(min = 6,max = 18,message = "用户名：最小长度不能低于6位,最大长度不能超过18位")
    private String userName;
    /**
     * 密码
     */
    @NotEmpty(message = "密码必须填写")
    @Length(min = 6,max = 18,message = "密码：最小长度不能低于6位,最大长度不能超过18位")
    private String passWord;
    /**
     * 手机号
     */
    @NotEmpty(message = "手机号必须填写")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机格式不正确")
    private String phone;
    /**
     * 短信验证码
     */
    @NotEmpty(message = "短信验证码必须填写")
    private String code;
}
